<?php
/**
 * @author: arian
 * @email: arian@dwebsite.com
 * @on: 06/23/08
 *
 */
 
 Zend_Loader::loadClass("BaseDBRows");
 Zend_Loader::loadClass("User");
 class Users extends BaseDBRows
 {
 	protected function setUp()
 	{
 		$this->_tableName = User::_tablename;
 	}
	
	public function setDeleted($ids)
	{
		if($ids){
			if(is_array($ids))
				$ids = implode(",", $ids);				
			
			$db = DBCon::instance();
			$db->executeCommand("UPDATE ". User::_tablename ." SET deleted = 1 WHERE id IN (". $ids . ")" );
		}
	}
	
	/**
 	 * load admins
 	 * @author: Arian Reyes
 	 * @on: 07/21/2008
 	 */
 	public function getAdmin($showAll = false)
 	{
		Zend_Loader::loadClass("UserType");
		
		$userType = new UserType();
		$userType->load("ADMIN");
		
 		if($showAll) 		
			$this->loadWhere(" user_type_id = 1 ");
 		else
 			$this->loadWhere(" deleted <> 1 AND user_type_id = " . $userType->id);
 	}
	
 }
?>